package com.uzai.console.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author mingyang.chen create in 2023/3/29 17:36
 */
@Getter
@AllArgsConstructor
public enum FriendRequestScene {

    PRIVATE_WECHAT_QQ(1, "QQ搜索"),
    PRIVATE_WECHAT_SEARCH(3, "搜索微信号"),
    PRIVATE_WECHAT_CARD(17, "微信卡片"),
    PRIVATE_WECHAT_GROUP(14, "群内"),
    PRIVATE_WECHAT_MOBILE(15, "手机号"),
    PRIVATE_WECHAT_QR_CODE(30, "扫描二维码"),
    UN_KNOW(0, "未知来源"),
    UN_KNOW_1(45, "未知来源1"),

    ;

    private final Integer value;
    private final String label;

    public Integer getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    public static FriendRequestScene getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (FriendRequestScene type : FriendRequestScene.values()) {
            if (type.getValue().equals(id)) {
                return type;
            }
        }
        return null;
    }
}
